package com.example.mybaseapp.ui.fragment.recommand

import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.RecyclerView


/**
 * @Description:
 * @Author: Seal
 * @CreateDate: 2020/7/13 19:14
 * @Version: 1.0
 */
class HorizontalSpaceItemDecoration : RecyclerView.ItemDecoration {
    private var right = 0
    private var left: Int
    private var top = 0
    private var bottom = 0

    constructor(right: Int) {
        this.left = right
    }

    constructor(right: Int, left: Int, top: Int, bottom: Int) {
        this.right = right
        this.left = left
        this.top = top
        this.bottom = bottom
    }

    override fun getItemOffsets(
        outRect: Rect,
        view: View,
        parent: RecyclerView,
        state: RecyclerView.State
    ) {
        outRect.left = left
        outRect.right = right
        outRect.bottom = bottom
        outRect.top = top
    }
}